

export class DataMgr1 {

    private static _instance: DataMgr1 = null;
    static get instance(): DataMgr1 {
        if (!this._instance) this._instance = new DataMgr1();
        return this._instance;
    }


    nowLevel: number = 6;

    tujians: Array<number> = []
    skins: Array<number> = [1];

    player: PlayerVo = new PlayerVo();
    // "us": {
    //     "userId": 10538,
    //     "nickname": "测试玩家",
    //     "head": "1",
    //     "jinYu": 2,
    //     "nuanYu": 0,
    //     "mingZhu": 0,
    //     "duanWei": 1
    //   }
    playerData: any = null;
    initPlayer(data) {
        this.playerData = data;

    }


    /**打卡统计 */
    clockData: Array<any> = null
    initClock(data) {
        this.clockData = data;
        // EventMgr.dispatch(EventName.UPDATE_PROP)
    }
    getClock(day) {
        return this.clockData.find((value) => { return value.day == day })
    }
    getClockCount(day) {
        let clock = this.getClock(day);
        return clock ? Number(clock.num) : 0;
    }

    /**果树信息 */
    bookData: any;
    initBook(data) {
        this.bookData = data.scriptures_set;
        // EventMgr.dispatch(EventName.UPDATE_TREE);
    }
    // getBook(treeId) {
    //     return this.treeData.find((value) => { return value.daoju_id == treeId })
    // }
    // getBookCount(treeId) {
    //     let tree = this.getTree(treeId);
    //     return tree ? parseInt(tree.id) : 0;
    // }





    updateRes() {

    }


    locations: Array<any> = [];
    initLocations(data) {
        this.locations.push(data);
    }


    gameConfig: any = {
        weibo: "微博名称",
        email: "2093793459@qq.com",
        group: "866789618"
    }

    gameData: any = null;

    boult: number = 0;
    // setBoult(value: number) {
    //     if (this.boult == value) return;
    //     this.boult = value;
    //     EventMgr.dispatch(EventName.UPDATE_BOULT)
    // }

    // addGameKey(value: number = 1) {
    //     let newValue = this.gameKey + value;
    //     this.setGameKey(newValue);
    // }

    // gameKey: number = 0;
    // setGameKey(value: number) {
    //     if (this.gameKey == value) return;
    //     this.gameKey = value;
    //     EventMgr.dispatch(EventName.UPDATE_GAME_KEY)
    // }


    // updateGameData(value: any) {
    //     this.gameData = value;
    //     this.setBoult(this.gameData.dicenum);
    //     this.setGameKey(0)
    // }

    initConfig(data: any) {

    }
}

export class PlayerVo {
    userId: number = 0;
    logintype: number;
    cusid: number;


    // private _keyCount: number = 10;
    // set keyCount(value) {
    //     if (value == this._keyCount) return;
    //     this._keyCount = value;
    //     EventMgr.dispatch(EventName.UPDATE_RES)
    // }
    // get keyCount() { return this._keyCount; }

    // /** 段位 */
    // private _cakeCount: number = 0;
    // set cakeCount(value) {
    //     if (this._cakeCount == value) return;
    //     this._cakeCount = value;
    //     EventMgr.dispatch(EventName.UPDATE_RES)
    // }
    // get cakeCount() { return this._cakeCount; }

    // /** 段位 */
    // private _starCount: number = 10;
    // set starCount(value) {
    //     if (this._starCount == value) return;
    //     this._starCount = value;
    //     EventMgr.dispatch(EventName.UPDATE_RES)
    // }
    // get starCount() { return this._starCount; }

    // private _headid: number = 1;
    // set headid(value) {
    //     if (this._headid == value) return;
    //     if (!value) value = 1;
    //     this._headid = value;
    //     EventMgr.dispatch(EventName.MAIN_HEADSHOT);
    // }
    // get headid() { return this._headid; }

    // private _nickName: string = "";
    // set nickName(value: string) {
    //     if (this._nickName == value) return;
    //     this._nickName = value;
    //     EventMgr.dispatch(EventName.UPDATE_NICKNAME);
    // }
    // get nickName() { return this._nickName; }


}
